package com.lyEducation.controllers.dto;

import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Objects;

@Getter
@Setter
public abstract class AbstractDto implements Serializable {
  @NotBlank(message = "id不能为空")
  private String id;

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (!(o instanceof AbstractDto)) return false;
    AbstractDto that = (AbstractDto) o;
    return Objects.equals(id, that.id);
  }

  @Override
  public int hashCode() {

    return Objects.hash(id);
  }
}
